#!/usr/bin/env python3
# coding: utf-8
"""
2024-02-19 
"""
from PySide6.QtWidgets import QTableWidget, QTableWidgetItem, QHeaderView, QAbstractItemView, QApplication, QWidget, QHBoxLayout, QVBoxLayout, QSizePolicy
from PySide6.QtCore import QSize
from top.wardyan.core.vo.vos import Record, TableCfg, TableColCfg
## from top.wardyan.core.
from top.wardyan.core.utils.tableutil import *
## from top.wardyan.core.vo
from top.wardyan.core.utils import winformutils






if __name__ == "__main__" :
    app = QApplication([])
    
    # 创建一个QWidget实例
    w = QWidget()

    # 设置窗口标题
    w.setWindowTitle('My First QWidget')
    
    # 设置窗口大小
    w.setGeometry(100, 100, 1024, 768)
    ## w.setContentsMargins(0, 0, 0, 0)
    
    hb : QHBoxLayout = QHBoxLayout()
    #hb.setContentsMargins(0, 0, 0, 0)
    w.setLayout(hb)

    table : QTableWidget = QTableWidget()

    hb.addWidget(table)
    
    table.setRowCount(100)
    table.setColumnCount(3)
    ## table.setColumnCount()
    
    table.setSelectionBehavior(QAbstractItemView.SelectRows)
    table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection)
    table.setEditTriggers(QTableWidget.EditTrigger.NoEditTriggers)
    for i in range(0, 100) :
        for j in range(0, 2) :
            item : QTableWidgetItem = QTableWidgetItem(str(i) + "-" + str(j))
            ## item.setFlags(Qt.ItemFlag.ItemIsEditable | Qt.ItemFlag.ItemIsSelectable)
            #item.setFlags(Qt.ItemFlag.ItemIsEditable )
            table.setItem(i,j,item)

    w.show()
    # t.layout()
    ## w.showFullScreen()
    #w.showMaximized()
    app.exec()
